using System;
using System.Collections.Generic;
using Library;
using Library.Util;
using NHibernate;

namespace Library.Persistence.Cloud.Dao
{
	public class CloudFirmaDuyuruDao : BaseEntity
	{
		private readonly string fromHql = " from CloudFirmaDuyuru as t ";
		public void Insert(CloudFirmaDuyuru dto)
		{
			BasePersistence.Insert(dto);
		}

		public void Update(CloudFirmaDuyuru dto)
		{
			BasePersistence.Update(dto);
		}

		public void Delete(CloudFirmaDuyuru dto)
		{
			BasePersistence.Delete(dto);
		}

		public void Delete(int firmaDuyuruId)
		{
			CloudFirmaDuyuru dto = new CloudFirmaDuyuru();
			dto.FirmaDuyuruId = firmaDuyuruId;
			Delete(dto);
		}

		public CloudFirmaDuyuru Get(int firmaDuyuruId, LockMode lockMode)
		{
			return Get<CloudFirmaDuyuru>(firmaDuyuruId, lockMode);
		}

		public List<CloudFirmaDuyuru> FindAll()
		{
			return Find<CloudFirmaDuyuru>(fromHql, LockMode.Read);
		}

		public List<CloudFirmaDuyuru> FindAll(string orderStatement)
		{
			return Find<CloudFirmaDuyuru>(fromHql + " ORDER BY " + orderStatement, LockMode.Read);
		}

	}
}
